<?php

class NewsBlockWidget extends BaseWidget
{
    public $oNews = array();

    public function init()
    {
        $oNewsCriteria             = new CDbCriteria();
        $oNewsCriteria->condition  = 'news_active = 1';
        $oNewsCriteria->order      = 'news_cdate DESC';
        $oNewsCriteria->limit      = 5;

        $this->template->oNews     = News::model()->findAll($oNewsCriteria);
    }
}